package com.zh.note.huawei.twohundred.最优资源分配;

import java.util.Scanner;

/**
 * @Author: zhanghuan
 * @date: 2023/8/10 19:12
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //每块芯片容量
        // int boardCapacity = sc.nextInt();
        int boardCapacity = 8;
        // 芯片数量
        // int numberOfChips = sc.nextInt();
        int numberOfChips = 2;
        // 芯片配置要求
        // String chipConfig = sc.nextLine();
        String chipConfig = "ACABA";

        int[] chipCapacity = new int[numberOfChips];
        int configCapacity;
        // 遍历"ACABA"
        for (int i = 0; i < chipConfig.length(); i++) {
            char chipType = chipConfig.charAt(i);
            switch (chipType) {
                case 'A':
                    configCapacity = 1;
                    break;
                case 'B':
                    configCapacity = 2;
                    break;
                default:
                    configCapacity = 8;
                    break;
            }
            // 遍历芯片数量
            for (int j = 0; j < numberOfChips; j++) {
                int used = chipCapacity[j];
                if (boardCapacity - used >= configCapacity) {
                    chipCapacity[j] += configCapacity;
                    break;
                }
            }
        }
        for (int i = 0; i < numberOfChips; i++) {
            StringBuilder sb = new StringBuilder();
            int userd = chipCapacity[i];
            for (int j = 0; j < boardCapacity; j++) {
                sb.append(j < userd ? "1" : "0");
            }
            System.out.println(sb);
        }

    }
}
